import { defineStore } from 'pinia';

export const useNewExcelStore = defineStore('newexcel', () => {
  const newExcelHeader = ref<any[]>([]);
  const newTitle = ref<string>('');
  const newSheetName = ref<string>('');
  const setExcelHeader = (header: any[], title: string, sheetName: string) => {
    newExcelHeader.value = header;
    newTitle.value = title;
    newSheetName.value = sheetName;
  };
  const getExcelHeader = () => {
    return newExcelHeader.value;
  };
  const getTitle = () => {
    return newTitle.value;
  };
  const getSheetName = () => {
    return newSheetName.value;
  };
  return {
    newExcelHeader,
    newTitle,
    newSheetName,
    setExcelHeader,
    getExcelHeader,
    getTitle,
    getSheetName,
  };
}, {
  persist: true,
});
